# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
pkgname=kauth5
pkgver=5.113.0
pkgrel=0
pkgdesc="Abstraction to system policy and authentication features"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-or-later"
depends_dev="
	kcoreaddons5-dev
	polkit-qt-dev
	qt5-qtbase-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	graphviz
	qt5-qttools-dev
	samurai
	"
_repo_url="https://invent.kde.org/frameworks/kauth.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kauth-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
builddir="$srcdir/kauth-$pkgver"

replaces="kauth<=5.110.0-r0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	# KAuthHelperTest hangs
	ctest --test-dir build --output-on-failure -E '(KAuthHelperTest)'
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
b0fe196aecf131046c2754414689f6c5f5bc4eec0a08fb9fe339155b2bc22d708fb7c68450845604897d10eda58f269b243ceb450cc16cff2ce9113b95f06143  kauth-5.113.0.tar.xz
"
